import asyncio
from asyncio import Runner

from agents import Agent

"""
agent
"""
english_agent = Agent(
    name='English Agent',
    instructions='你只会说英语，回答用户的问题'
)

spanish_agent = Agent(
    name="Spanish Agent",
    instructions="你只会说西班牙语，回答用户的问题。"
)

triage_agent = Agent(
    name="Triage Agent",
    instructions="根据用户语言，把任务交给合适的助手。",
    handoffs=[english_agent, spanish_agent]
)

"""
# 异步运行
"""


async def main():
    result = await Runner.run(triage_agent, input="Hola, ¿cómo estás?")
    print(result.final_output)


def test():
    asyncio.run(main())
